package sicau.practice.community.Controller;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import sicau.practice.community.Mapper.TieziMapper;
import sicau.practice.community.dto.Tiezi;

import java.util.List;

@Controller
public class ListController {

    @Autowired
    private TieziMapper tieziMapper;

    @RequestMapping("/list")
    public String list(Model model){

        List<Tiezi> tieziList = tieziMapper.list();

        model.addAttribute("tieziList",tieziList);
        return "list";
    }
}
